package jmine.tec.utils.date;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * Enum that contains time units.
 * 
 * @author Fabio Sakiyama
 */
public enum TimeUnitEnum implements MessageCreator {

    HOURS("utils.time.unit.hours"),

    MINUTES("utils.time.unit.minutes"),

    SECONDS("utils.time.unit.seconds");

    private final MessageCreator unitName;

    /**
     * C'tor
     * 
     * @param unitNameKey name of the time unit
     */
    private TimeUnitEnum(String unitNameKey) {
        this.unitName = MessageCreatorHelper.creator("jmine-tec-utils-messages", unitNameKey, 0);
    }

    /**
     * @return the unitName
     */
    public LocalizedMessageHolder getUnitName() {
        return this.unitName.create();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return this.getUnitName().getMessage();
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.unitName.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.unitName.getExpectedArguments();
    }

}